\f0\fs28 is responsible for the menu cell update, where
\f1\fs24 aSelector
\f0\fs28 is your own update method, and
\f1\fs24 aMenu
\f0\fs28 the menu you want to update. This method has to be called inside
\f1\fs24 appDidInit:
\f0\fs28 because NXApp is responsible for the update. Doing so makes your program more efficient, since it needs to be done only once.\
\
Q: Should I use the application method
\f1\fs24 setAutoupdate:(BOOL)flag
\f0\fs28 or the menu
\f1\fs24 update
\f0\fs28 method for updating the menu items? What are the trade-offs?\
\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 A: The application method
\f1\fs24 setAutoupdate:YES
\f0\fs28 causes the menus to stay up to date all the time (i.e., it only updates them when they are on-screen). Calling
\f1\fs24 update
\f0\fs28 directly every time something changes might be a lot of extra work for nothing. However, if things rarely change in the menu, it might be worth not incurring the window list traversal
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\fs24\fc1\cf1 /* Initializes the updateAction method for the menu cells.\
setAutoupdate:YES means that updateWindows will be called\
after every event is processed (to keep the menu items up to date).\
*/\
- appDidInit:sender\
\{\
........\
initMenu([NXApp mainMenu]);\
[NXApp setAutoupdate:YES];\
return self;\
\}\
\
#define TOGGLE 4 /* Some integer cell tag value */\
\
- (BOOL)menuItemUpdate:menuCell\
/* Here goes your own code for menu cell update. This is only a simple example \
which toggles the state of the selected cell. The return value YES means\